home *** CD-ROM | disk | FTP | other *** search
- /*
- * testsegm.c
- *
- * Practical Algorithms for Image Analysis
- *
- * Copyright (c) 1997, 1998, 1999 MLMSoftwareGroup, LLC
- */
-
- /*
- * TESTSEGM
- *
- * initialize 11 test segments for xllist.c, xsall.c
- * (LRM horizontal and vertical test segments)
- *
- * ms, 11/90;
- */
- #include <stdio.h>
- #include <stdlib.h>
-
- #include "lldef.h"
- #include "xsgll.h"
-
-
-
-
- void
- init_testsegm (testsegm, n_segm)
- struct Segm *testsegm;
- int n_segm;
- {
-
- if (n_segm != 11) {
- printf ("\n...TOTAL_SEG must equal 11 in this test routine\n");
- exit (1);
- }
-
- /* nearly horizontal or nearly vertical segm */
-
- (testsegm + 0)->ptO.x = 336;
- (testsegm + 0)->ptO.y = 174;
- (testsegm + 0)->ptF.x = 336;
- (testsegm + 0)->ptF.y = 275;
- (testsegm + 0)->slope = fslope ((testsegm + 0)->ptO, (testsegm + 0)->ptF);
- (testsegm + 0)->line_ind = 0;
-
- (testsegm + 1)->ptO.x = 364;
- (testsegm + 1)->ptO.y = 174;
- (testsegm + 1)->ptF.x = 364;
- (testsegm + 1)->ptF.y = 275;
- (testsegm + 1)->slope = fslope ((testsegm + 1)->ptO, (testsegm + 1)->ptF);
- (testsegm + 1)->line_ind = 1;
-
- (testsegm + 2)->ptO.x = 393;
- (testsegm + 2)->ptO.y = 174;
- (testsegm + 2)->ptF.x = 393;
- (testsegm + 2)->ptF.y = 275;
- (testsegm + 2)->slope = fslope ((testsegm + 2)->ptO, (testsegm + 2)->ptF);
- (testsegm + 2)->line_ind = 2;
-
- (testsegm + 3)->ptO.x = 96;
- (testsegm + 3)->ptO.y = 187;
- (testsegm + 3)->ptF.x = 162;
- (testsegm + 3)->ptF.y = 187;
- (testsegm + 3)->slope = fslope ((testsegm + 3)->ptO, (testsegm + 3)->ptF);
- (testsegm + 3)->line_ind = 3;
-
- (testsegm + 4)->ptO.x = 289;
- (testsegm + 4)->ptO.y = 195;
- (testsegm + 4)->ptF.x = 289;
- (testsegm + 4)->ptF.y = 299;
- (testsegm + 4)->slope = fslope ((testsegm + 4)->ptO, (testsegm + 4)->ptF);
- (testsegm + 4)->line_ind = 4;
-
- (testsegm + 5)->ptO.x = 313;
- (testsegm + 5)->ptO.y = 195;
- (testsegm + 5)->ptF.x = 313;
- (testsegm + 5)->ptF.y = 299;
- (testsegm + 5)->slope = fslope ((testsegm + 5)->ptO, (testsegm + 5)->ptF);
- (testsegm + 5)->line_ind = 5;
-
- (testsegm + 6)->ptO.x = 264;
- (testsegm + 6)->ptO.y = 196;
- (testsegm + 6)->ptF.x = 264;
- (testsegm + 6)->ptF.y = 302;
- (testsegm + 6)->slope = fslope ((testsegm + 6)->ptO, (testsegm + 6)->ptF);
- (testsegm + 6)->line_ind = 6;
-
- (testsegm + 7)->ptO.x = 96;
- (testsegm + 7)->ptO.y = 216;
- (testsegm + 7)->ptF.x = 162;
- (testsegm + 7)->ptF.y = 216;
- (testsegm + 7)->slope = fslope ((testsegm + 7)->ptO, (testsegm + 7)->ptF);
- (testsegm + 7)->line_ind = 7;
-
- (testsegm + 8)->ptO.x = 96;
- (testsegm + 8)->ptO.y = 246;
- (testsegm + 8)->ptF.x = 162;
- (testsegm + 8)->ptF.y = 246;
- (testsegm + 8)->slope = fslope ((testsegm + 8)->ptO, (testsegm + 8)->ptF);
- (testsegm + 8)->line_ind = 8;
-
- (testsegm + 9)->ptO.x = 85;
- (testsegm + 9)->ptO.y = 272;
- (testsegm + 9)->ptF.x = 155;
- (testsegm + 9)->ptF.y = 272;
- (testsegm + 9)->slope = fslope ((testsegm + 9)->ptO, (testsegm + 9)->ptF);
- (testsegm + 9)->line_ind = 9;
-
- (testsegm + 10)->ptO.x = 78;
- (testsegm + 10)->ptO.y = 298;
- (testsegm + 10)->ptF.x = 148;
- (testsegm + 10)->ptF.y = 298;
- (testsegm + 10)->slope = fslope ((testsegm + 10)->ptO, (testsegm + 10)->ptF);
- (testsegm + 10)->line_ind = 10;
-
- }
-